<c:set var="maxRow" value="1000" />
<%-- 列表页导出区，不能单独使用，提供给paging.jsp include --%>
<c:set var="_PrmTotalItems">${sc.totalCount}</c:set>

<%----------- 导出的文件类型-------------%>
<input type="hidden" name="d-export-e" id="d-export-e" value="2" disabled="disabled" />

<%----------- 对应org.displaytag.tags.TableTagParameters.PARAMETER_EXPORTING-------------%>
<input type="hidden" name="6578706f7274" id="6578706f7274" value="2" disabled="disabled" />

<input type="hidden" name="export-all" id="export-all" value="true" disabled="disabled"/>
<script type="text/javascript">
function fnExport($frm){
	var param2 = document.getElementById("d-export-e");
	var param3 = document.getElementById("6578706f7274");
	param2.disabled=false;
	param3.disabled=false;
	$frm.submit();
	param2.disabled=true;
	param3.disabled=true;
}
function fnExportPartition($first,$max,$partIndex){
	var firstR = document.getElementById("PrmPageFirstResult");
	var partIndex = document.getElementById("PrmPagePart");
	var maxR = document.getElementById("PrmPageMaxResults");
	firstR.value = $first;
	maxR.value = $max;
	partIndex.value = $partIndex;
}
function fnShowFiles($option){
	var exportAllPage = ($option.value=='allPage');
	if (exportAllPage){
		document.getElementById("export-all").disabled = false;
	}else{
		document.getElementById("export-all").disabled = true;
	}
<c:if test="${_PrmTotalItems+0 > maxRow}">
	var files = document.getElementById("export-files");
	if (exportAllPage){
        files.style.display="";
	}else{
	    files.style.display="none";
	}
</c:if>
}
</script>
<c:if test="${_PrmTotalItems+0 > maxRow}">
	<DIV class=exportlinks id="export-files" style="display: none">
		<fmt:message key="list.paging.listFile" />:&nbsp;
		<c:set var="count" value="1" />
		<c:set var="previous" value="0" />
		<c:forEach var="current" begin="1" end="${_PrmTotalItems}" step="${maxRow}">
			<c:if test="${previous > 0}">
				<c:if test="${count == 1}">
					<input type="hidden" name="PrmPageFirstResult" id="PrmPageFirstResult" value="${previous-1}" />
					<input type="hidden" name="PrmPageMaxResults" id="PrmPageMaxResults" value="${maxRow}" />
					<input type="hidden" name="PrmPagePart" id="PrmPagePart" value="${count}" />
				</c:if>
				<input id="file${count}" name="radiobutton" type="radio" value="radiobutton" onclick="fnExportPartition('${previous-1}','${maxRow}','${count}')" <c:if test="${count == 1}">checked="checked"</c:if> />
				<label for="file${count}"><fmt:message key="list.paging.file" />${count}</label>
				<c:set var="count" value="${count+1}" />
			</c:if>
			<c:set var="previous" value="${current}" />
		</c:forEach>
		<c:if test="${previous < _PrmTotalItems}">
			<input id="file${count}" name="radiobutton" type="radio" value="radiobutton" onclick="fnExportPartition('${previous-1}','${maxRow}','${count}')" />
			<label for="file${count}"><fmt:message key="list.paging.file" />${count}</label>
		</c:if>
	</DIV>
</c:if>

<div class="operate">
	<select class="selecttxt" title="<fmt:message key='export.exFormat'/>" onchange="$j('#d-export-e').val(this.value)">
			<option value="2">Excel</option>
			<option value="5">PDF</option>
			<option value="3">XML</option>
			<option value="1">CSV</option>
	</select>
	<select class="selecttxt" title="<fmt:message key='export.exPageChoise'/>" onchange="fnShowFiles(this)">
			<option value="currPage"><fmt:message key="export.exCurrentPage"/></option>
			<option value="allPage"><fmt:message key="export.exAllPage"/></option>
	</select>
	<input type="button" class="btn2"  value="<fmt:message key='export.exportThisPage'/>" onclick="fnExport(this.form)"/>
</div>